(function(){
 
	var gridpanel = {};
	
	gridpanel.title	=	"字段";
	gridpanel.plugins=new Ext.grid.plugin.CellEditing({
         clicksToEdit: 1
     });
	gridpanel.columns=[{
    	xtype: 'actioncolumn',
        width: 30,
        sortable: false,
        menuDisabled: true,
        items: [{
        	icon: "lib/ext/shared/icons/fam/delete.gif",
            tooltip: 'Delete',
            scope: this,
            handler:function(grid, rowIndex, colIndex, actionItem, event, record, row){
            	grid.store.remove(record);
            }
        }]
		},
		
		 { header: '列名 ', dataIndex: 'text', editor: {
             allowBlank: true ,
         }},
         { header: '字段 ', dataIndex: 'name', editor: {
             allowBlank: true 
         }},
        { header: '类型 ', dataIndex: 'type',   editor: {
        	  allowBlank: true ,
              xtype:"combobox",
              store: [
                  ['string' ,'string'],
                  ['int'	,'int'],
                  ['float'  ,'float'],
                  ['text'   ,'text'],
                  ['date'   ,'date'],
                  ['obj'    ,'obj'],
                  ['list'   ,'list']
              ]
        }},
        { header: '百分百宽度 ', dataIndex: 'flex', editor: {
        	xtype: 'numberfield',
            allowBlank: true,
            minValue: 0,
            maxValue: 100000  
        }},
       /* { header: '是否唯一 ', dataIndex: 'isonly', editor: {
            allowBlank: false ,
            xtype:"combobox",
            store: [
            	 [true,'是'],
                 [false,'否'] 
            ]
        }},*/
        { header: '长度 ', dataIndex: 'length',  editor: {
        	xtype: 'numberfield',
            allowBlank: true,
            minValue: 0,
            maxValue: 100000  
        }},
        { header: '排序 ', dataIndex: 'index', editor: {  
        	xtype: 'numberfield',
            allowBlank: true,
            minValue: 0,
            maxValue: 100000  
        }},
        { header: '是否隐藏', dataIndex: 'ishide',  editor: {
            allowBlank: true ,
            xtype:"combobox",
            store: [
                [true,'是'],
                [false,'否'] 
            ]
        }},
        /*{ header: '校验  ', dataIndex: 'regex', editor: {
            allowBlank: false 
        }},
        { header: '校验信息 ', dataIndex: 'regexText',  editor: {
            allowBlank: false 
        }},*/
        { header: '类 ', dataIndex: 'clazz', editor: {
            allowBlank: true 
        }},
        { header: '类字段 ', dataIndex: 'clazzQuery',  editor: {
            allowBlank: true 
        }},
        { header: '加载', dataIndex: 'changeRender',  editor: {
            allowBlank: true 
        }},{ header: '聚焦', dataIndex: 'changeFocus',  editor: {
            allowBlank: true 
        }},{ header: '改变', dataIndex: 'changeRules',  editor: {
            allowBlank: true 
        }},{ header: '失焦',flex:1,  dataIndex: 'changeBlur',  editor: {
            allowBlank: true 
        }}
    ];
	
	gridpanel.tbar = [];
	gridpanel.tbar.push({
		 text: "添加",  
         handler: function() {  
        	 this.ownerCt.ownerCt.store.add({
        		 text:"",
        		 name:"f"+getOnly(),
        		 type:"string",
        		 flex:1,
        		 isonly:false,
        		 length:100,
        		 index:1,
        		 ishide:false
        	 });
         }  
	});
	gridpanel.xtype="grid";
	gridpanel.store={
		data:[],
	    proxy: {
	        type: 'memory',
	        reader: {
	            type: 'json' 
	        }
	    }	
	};
	gridpanel.id = "fi10";
	return gridpanel;
})